import 'package:healthy_station_flutter/generated/json/base/json_convert_content.dart';
import 'package:healthy_station_flutter/entity/develop_resident_entity.dart';

DevelopResidentEntity $DevelopResidentEntityFromJson(
    Map<String, dynamic> json) {
  final DevelopResidentEntity developResidentEntity = DevelopResidentEntity();
  final String? userId = jsonConvert.convert<String>(json['userId']);
  if (userId != null) {
    developResidentEntity.userId = userId;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    developResidentEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    developResidentEntity.name = name;
  }
  final String? sex = jsonConvert.convert<String>(json['sex']);
  if (sex != null) {
    developResidentEntity.sex = sex;
  }
  final String? age = jsonConvert.convert<String>(json['age']);
  if (age != null) {
    developResidentEntity.age = age;
  }
  final String? nation = jsonConvert.convert<String>(json['nation']);
  if (nation != null) {
    developResidentEntity.nation = nation;
  }
  final String? birth = jsonConvert.convert<String>(json['birth']);
  if (birth != null) {
    developResidentEntity.birth = birth;
  }
  final String? certifcateNo = jsonConvert.convert<String>(
      json['certifcateNo']);
  if (certifcateNo != null) {
    developResidentEntity.certifcateNo = certifcateNo;
  }
  final String? mobilephone = jsonConvert.convert<String>(json['mobilephone']);
  if (mobilephone != null) {
    developResidentEntity.mobilephone = mobilephone;
  }
  final String? nativePlace = jsonConvert.convert<String>(json['nativePlace']);
  if (nativePlace != null) {
    developResidentEntity.nativePlace = nativePlace;
  }
  final String? addr = jsonConvert.convert<String>(json['addr']);
  if (addr != null) {
    developResidentEntity.addr = addr;
  }
  final String? height = jsonConvert.convert<String>(json['height']);
  if (height != null) {
    developResidentEntity.height = height;
  }
  final String? weight = jsonConvert.convert<String>(json['weight']);
  if (weight != null) {
    developResidentEntity.weight = weight;
  }
  final String? diabetes = jsonConvert.convert<String>(json['diabetes']);
  if (diabetes != null) {
    developResidentEntity.diabetes = diabetes;
  }
  final String? fpg = jsonConvert.convert<String>(json['fpg']);
  if (fpg != null) {
    developResidentEntity.fpg = fpg;
  }
  return developResidentEntity;
}

Map<String, dynamic> $DevelopResidentEntityToJson(
    DevelopResidentEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['userId'] = entity.userId;
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['sex'] = entity.sex;
  data['age'] = entity.age;
  data['nation'] = entity.nation;
  data['birth'] = entity.birth;
  data['certifcateNo'] = entity.certifcateNo;
  data['mobilephone'] = entity.mobilephone;
  data['nativePlace'] = entity.nativePlace;
  data['addr'] = entity.addr;
  data['height'] = entity.height;
  data['weight'] = entity.weight;
  data['diabetes'] = entity.diabetes;
  data['fpg'] = entity.fpg;
  return data;
}

extension DevelopResidentEntityExtension on DevelopResidentEntity {
  DevelopResidentEntity copyWith({
    String? userId,
    String? id,
    String? name,
    String? sex,
    String? age,
    String? nation,
    String? birth,
    String? certifcateNo,
    String? mobilephone,
    String? nativePlace,
    String? addr,
    String? height,
    String? weight,
    String? diabetes,
    String? fpg,
  }) {
    return DevelopResidentEntity()
      ..userId = userId ?? this.userId
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..sex = sex ?? this.sex
      ..age = age ?? this.age
      ..nation = nation ?? this.nation
      ..birth = birth ?? this.birth
      ..certifcateNo = certifcateNo ?? this.certifcateNo
      ..mobilephone = mobilephone ?? this.mobilephone
      ..nativePlace = nativePlace ?? this.nativePlace
      ..addr = addr ?? this.addr
      ..height = height ?? this.height
      ..weight = weight ?? this.weight
      ..diabetes = diabetes ?? this.diabetes
      ..fpg = fpg ?? this.fpg;
  }
}